﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using ShellInfrastructure;
using ModuleProduct.Views;
using ModuleProduct;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Modularity;
using EventInfrastructure;



namespace ShopShell.Commands
{

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class ProductShowCommand : ICommand
    {

        [Dependency]
        public IRegionManager RegionManager { get; set; }

        [Dependency]
        public IEventAggregator EventAggregator { get; set; }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            EventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            EventAggregator.GetEvent<ShowProductEvent>().Publish(true);
            EventAggregator.GetEvent<SelectCategoryEvent>().Publish(true);
        }

    }
}
